export const setStorage = (key, data) => {
  /**
   * @description 本地存储数据
   * @param {String,String} 
   */
  try {
    wx.setStorageSync(key, data)
  } catch (error) {
    console.error("存储" + key + "发生了" + error)
  }
}
export const getStorage = (key) => {
  /**
   * @description 本地获取数据
   * @param {String}
   */
  try {
    const res = wx.getStorageSync(key)
    if (res) {
      return res
    }
  } catch (error) {
    console.error("获取" + key + "发生了" + error)
  }
}
export const removeStorage = (key) => {
  /**
   * @description 本地移除某一项数据
   * @param {String} 要移除的key名
   */
  try {
    wx.removeStorageSync(key)
  } catch (error) {
    console.error("移除" + key + "发生了" + error)
  }
}
export const clearStorage = () => {
  /**
   * @description 清空本地数据
   * @param {}
   */
  try {
    wx.clearStorageSync()
  } catch (error) {
    console.error("清空存储时发生了" + error)
  }
}